﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.DataProvider.SQL
{
    class InfoDemoData
    {
        public static Data.DataResult QueryData(Metadata.DataSource dataSource, Metadata.DataSet dataSet, List<QueryParameter> parameters)
        {
            if (dataSet.Name == "INFODEMO_ZYDFLTJ")
            {
                return INFODEMO_ZYDFLTJ();
            }
            else if (dataSet.Name == "INFODEMO_ZYDFLTJLB")
            {
                return INFODEMO_ZYDFLTJLB();
            }
            else if (dataSet.Name == "INFODEMO_XTHYD")
            {
                return INFODEMO_XTHYD();
            }
            else if (dataSet.Name == "INFODEMO_JGJB")
            {
                return INFODEMO_JGJB();
            }
            else if (dataSet.Name == "INFODEMO_JGJBLB")
            {
                return INFODEMO_JGJBLB();
            }
            else if (dataSet.Name == "INFODEMO_XTFWL")
            {
                return INFODEMO_XTFWL();
            }
            else if (dataSet.Name == "INFODEMO_JGLBZBTJ")
            {
                return INFODEMO_JGLBZBTJ();
            }
            else if (dataSet.Name == "INFODEMO_GJZTTJ")
            {
                return INFODEMO_GJZTTJ();
            }
            else if (dataSet.Name == "INFODEMO_JGJDLB")
            {
                return INFODEMO_JGJDLB();
            }
            else if (dataSet.Name == "INFODEMO_WARNTOP10")
            {
                return INFODEMO_WARNTOP10();
            }
            else if (dataSet.Name == "INFODEMO_BADTOP10")
            {
                return INFODEMO_BADTOP10();
            }
            else if (dataSet.Name == "INFODEMO_GJTJ")
            {
                return INFODEMO_GJTJ();
            }
            else if (dataSet.Name == "INFODEMO_RF")
            {
                return INFODEMO_RF();
            }
            else if (dataSet.Name.Equals("INFODEMO_DKLYL"))
            {
                return INFODEMO_DKLYL();
            }
            else if (dataSet.Name.Equals("INFODEMO_DKLYL_BG"))
            {
                return INFODEMO_DKLYL_BG();
            }
            else if (dataSet.Name.Equals("INFODEMO_WLSBXN"))
            {
                return INFODEMO_WLSBXN();
            }
            else if (dataSet.Name.Equals("INFODEMO_OVIS"))
            {
                return INFODEMO_OVIS();
            }
            else if (dataSet.Name.Equals("INFODEMO_LL"))
            {
                return INFODEMO_LL();
            }
            else if (dataSet.Name.Equals("INFODEMO_WLGJLB"))
            {
                return INFODEMO_WLGJLB();
            }
            return null;
        }

        /// <summary>
        /// 资源点分类统计 模拟数据
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_ZYDFLTJ()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_ZYDFLTJ";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "ZYDFLTJ";
            series.Name = "资源点分类统计";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            string[] ids = new string[] { "sys", "db", "net", "sto", "com" };
            string[] names = new string[] { "系统", "数据库", "网络", "存储", "中间件" };

            double leftValue = 100;
            for (int index = 0; index < ids.Length; index++)
            {
                double value = new Random().NextDouble() * leftValue;
                Data.DataItem item = new Data.DataItem();
                item.Id = ids[index];
                item.Name = names[index];
                item.Value = value.ToString("F2");
                series.DataItems.Add(item);

                leftValue = leftValue - value;
                System.Threading.Thread.Sleep(10);
            }

            return result;
        }

        /// <summary>
        /// 资源点分类统计列表 模拟数据
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_ZYDFLTJLB()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_ZYDFLTJLB";
            result.DataSeries = new List<Data.DataSeries>();

            string[] ids = new string[] { "sys", "db", "net", "sto", "com" };
            string[] names = new string[] { "系统", "数据库", "网络", "存储", "中间件" };

            double leftValue = 100;
            for (int index = 0; index < ids.Length; index++)
            {
                double value = new Random().NextDouble() * leftValue;

                Data.DataSeries series = new Data.DataSeries();
                series.Id = "ZYDFLTJLB";
                series.Name = "资源点分类统计列表";
                series.DataItems = new List<Data.DataItem>();
                result.DataSeries.Add(series);

                Data.DataItem nitem = new Data.DataItem();
                nitem.Id = "n";
                nitem.Name = "n";
                nitem.Value = names[index];
                series.DataItems.Add(nitem);

                Data.DataItem item = new Data.DataItem();
                item.Id = "v";
                item.Name = "v";
                item.Value = value.ToString("F2");
                series.DataItems.Add(item);

                leftValue = leftValue - value;
                System.Threading.Thread.Sleep(10);
            }

            return result;
        }

        /// <summary>
        /// 系统活跃度 模拟数据
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_XTHYD()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_XTHYD";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "XTHYD";
            series.Name = "系统活跃度";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            for (int index = 0; index < 15; index++)
            {
                Data.DataItem item = new Data.DataItem();
                item.Id = index.ToString();
                item.Name = DateTime.Now.AddDays(-1 * index).ToString("M.d");
                item.Value = new Random().Next(1, 70).ToString();
                series.DataItems.Add(item);
                System.Threading.Thread.Sleep(10);
            }

            return result;
        }

        /// <summary>
        /// 警告级别统计 模拟数据
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_JGJB()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_JGJB";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "JGJB";
            series.Name = "警告级别统计";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            string[] ids = new string[] { "normal", "warn", "bad", "unknown" };
            string[] names = new string[] { "正常", "微轻", "重大", "未知" };

            double leftValue = 100;
            for (int index = 0; index < ids.Length; index++)
            {
                double value = new Random().NextDouble() * leftValue;
                Data.DataItem item = new Data.DataItem();
                item.Id = ids[index];
                item.Name = names[index];
                item.Value = value.ToString("F2");
                series.DataItems.Add(item);

                leftValue = leftValue - value;
            }

            return result;
        }

        /// <summary>
        /// 警告级别列表 模拟数据
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_JGJBLB()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_JGJBLB";
            result.DataSeries = new List<Data.DataSeries>();


            string[] ids = new string[] { "normal", "warn", "bad", "unknown" };
            string[] names = new string[] { "正常", "微轻", "重大", "未知" };

            double leftValue = 100;
            for (int index = 0; index < ids.Length; index++)
            {
                double value = new Random().NextDouble() * leftValue;

                Data.DataSeries series = new Data.DataSeries();
                series.Id = "JGJBLB";
                series.Name = "警告级别统计";
                series.DataItems = new List<Data.DataItem>();
                result.DataSeries.Add(series);

                Data.DataItem nitem = new Data.DataItem();
                nitem.Id = "n";
                nitem.Name = "n";
                nitem.Value = names[index];
                series.DataItems.Add(nitem);

                Data.DataItem item = new Data.DataItem();
                item.Id = "v";
                item.Name = "v";
                item.Value = value.ToString("F2");
                series.DataItems.Add(item);

                leftValue = leftValue - value;
            }

            return result;
        }

        /// <summary>
        /// 系统访问量 模拟数据
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_XTFWL()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_XTFWL";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "XTFWL";
            series.Name = "系统活跃度";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            for (int index = 0; index < 15; index++)
            {
                Data.DataItem item = new Data.DataItem();
                item.Id = index.ToString();
                item.Name = DateTime.Now.AddDays(-1 * index).ToString("M.d");
                item.Value = new Random().Next(1, 70).ToString();
                series.DataItems.Add(item);
                System.Threading.Thread.Sleep(10);
            }

            return result;
        }

        /// <summary>
        /// 警告类别占比统计
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_JGLBZBTJ()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_JGLBZBTJ";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "JGLBZBTJ";
            series.Name = "警告类占比统计";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            string[] ids = new string[] { "com", "sys" };
            string[] names = new string[] { "中间件", "系统" };

            double leftValue = 100;
            for (int index = 0; index < ids.Length; index++)
            {
                double value = new Random().NextDouble() * leftValue;
                Data.DataItem item = new Data.DataItem();
                item.Id = ids[index];
                item.Name = names[index];
                item.Value = value.ToString("F2");
                series.DataItems.Add(item);

                leftValue = leftValue - value;
            }

            return result;
        }

        /// <summary>
        /// 告警状态统计
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_GJZTTJ()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_GJZTTJ";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "GJZTTJ";
            series.Name = "告警状态统计";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            string[] ids = new string[] { "closed", "active" };
            string[] names = new string[] { "已关闭", "未处理" };

            double leftValue = 100;
            for (int index = 0; index < ids.Length; index++)
            {
                double value = new Random().NextDouble() * leftValue;
                Data.DataItem item = new Data.DataItem();
                item.Id = ids[index];
                item.Name = names[index];
                item.Value = value.ToString("F2");
                series.DataItems.Add(item);

                leftValue = leftValue - value;
            }

            return result;
        }

        /// <summary>
        /// 警告节点列表
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_JGJDLB()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_JGJDLB";
            result.DataSeries = new List<Data.DataSeries>();

            string[] nodeIds = new string[]{
                "pmqd",
                "广西油库",
                "10.120.142.115",
                "PPS-WEB-HV-08",
                "10.120.142.111",
            };

            string[] sysIds = new string[]{
                "B4-01",
                "C5-03",
                "A3-01",
            };

            for (int indexNode = 0; indexNode < nodeIds.Length; indexNode++)
            {
                for (int indexSys = 0; indexSys < sysIds.Length; indexSys++)
                {
                    Data.DataSeries series = new Data.DataSeries();
                    series.Id = string.Format("{0}_{1}", nodeIds[indexNode], sysIds[indexSys]);
                    series.Name = series.Id;
                    series.DataItems = new List<Data.DataItem>();
                    result.DataSeries.Add(series);

                    double state = new Random().Next(0, 3);
                    Data.DataItem itemState = new Data.DataItem();
                    itemState.Id = "state";
                    itemState.Name = "状态";
                    itemState.Value = state.ToString();
                    series.DataItems.Add(itemState);

                    // 最早发生事件
                    int beginDate = new Random().Next(40, 100);
                    Data.DataItem itemFT = new Data.DataItem();
                    itemFT.Id = "firsttime";
                    itemFT.Name = "最早发生时间";
                    itemFT.Value = DateTime.Now.AddDays(-1 * beginDate).ToString("yyyy-MM-dd HH:mm:ss");
                    series.DataItems.Add(itemFT);

                    // 最晚发生时间
                    int latestDate = new Random().Next(1, 40);
                    Data.DataItem itemLT = new Data.DataItem();
                    itemLT.Id = "latesttime";
                    itemLT.Name = "最晚发生时间";
                    itemLT.Value = DateTime.Now.AddDays(-1 * latestDate).ToString("yyyy-MM-dd HH:mm:ss");
                    series.DataItems.Add(itemLT);

                    // 节点
                    Data.DataItem itemNode = new Data.DataItem();
                    itemNode.Id = "node";
                    itemNode.Name = "节点";
                    itemNode.Value = nodeIds[indexNode];
                    series.DataItems.Add(itemNode);

                    // 系统
                    Data.DataItem itemSys = new Data.DataItem();
                    itemSys.Id = "sys";
                    itemSys.Name = "节点";
                    itemSys.Value = sysIds[indexSys];
                    series.DataItems.Add(itemSys);
                    System.Threading.Thread.Sleep(10);
                }
            }

            return result;
        }

        /// <summary>
        /// 网络告警列表
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_WLGJLB()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_WLGJLB";
            result.DataSeries = new List<Data.DataSeries>();

            string[] nodeIds = new string[]{
                "pmqd",
                "广西油库",
                "10.120.142.115",
                "PPS-WEB-HV-08",
                "10.120.142.111",
            };

            string[] sysIds = new string[]{
                "B4-01",
                "C5-03",
                "A3-01",
            };

            string[] sysTitles = new string[]{
                "主机pmqd(10.29.65.24)的MQ服务MQ通道自定义失败",
                "油库广西网络中断，故障率为27.27%，影响站点数量为3",
                "节点A3-SC-S5500-B-01 上的接口GigabitEthernet1/0/50的输出利用率为06.1617已经超",
            };

            for (int indexNode = 0; indexNode < nodeIds.Length; indexNode++)
            {
                for (int indexSys = 0; indexSys < sysIds.Length; indexSys++)
                {
                    Data.DataSeries series = new Data.DataSeries();
                    series.Id = string.Format("{0}_{1}", nodeIds[indexNode], sysIds[indexSys]);
                    series.Name = series.Id;
                    series.DataItems = new List<Data.DataItem>();
                    result.DataSeries.Add(series);

                    double state = new Random().Next(0, 3);
                    Data.DataItem itemState = new Data.DataItem();
                    itemState.Id = "state";
                    itemState.Name = "状态";
                    itemState.Value = state.ToString();
                    series.DataItems.Add(itemState);

                    // 最早发生事件
                    int beginDate = new Random().Next(40, 100);
                    Data.DataItem itemFT = new Data.DataItem();
                    itemFT.Id = "firsttime";
                    itemFT.Name = "最早发生时间";
                    itemFT.Value = DateTime.Now.AddDays(-1 * beginDate).ToString("yyyy-MM-dd HH:mm:ss");
                    series.DataItems.Add(itemFT);

                    // 最晚发生时间
                    int latestDate = new Random().Next(1, 40);
                    Data.DataItem itemLT = new Data.DataItem();
                    itemLT.Id = "latesttime";
                    itemLT.Name = "最晚发生时间";
                    itemLT.Value = DateTime.Now.AddDays(-1 * latestDate).ToString("yyyy-MM-dd HH:mm:ss");
                    series.DataItems.Add(itemLT);

                    // 节点
                    Data.DataItem itemNode = new Data.DataItem();
                    itemNode.Id = "node";
                    itemNode.Name = "节点";
                    itemNode.Value = nodeIds[indexNode];
                    series.DataItems.Add(itemNode);

                    // 系统
                    Data.DataItem itemSys = new Data.DataItem();
                    itemSys.Id = "sys";
                    itemSys.Name = "系统";
                    itemSys.Value = sysIds[indexSys];
                    series.DataItems.Add(itemSys);

                    // 标题
                    Data.DataItem itemTitle = new Data.DataItem();
                    itemTitle.Id = "Title";
                    itemTitle.Name = "标题";
                    itemTitle.Value = sysTitles[indexSys];
                    series.DataItems.Add(itemTitle);

                    // 重复次数 
                    Data.DataItem itemCount = new Data.DataItem();
                    itemCount.Id = "Count";
                    itemCount.Name = "重复次数";
                    itemCount.Value = new Random().Next(0, 5).ToString();
                    series.DataItems.Add(itemCount);
                    System.Threading.Thread.Sleep(10);
                }
            }

            return result;
        }

        /// <summary>
        /// 警告top10
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_WARNTOP10()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_WARNTOP10";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "WARNTOP10";
            series.Name = "警告top10";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            string[] ids = new string[] {
                "ERPEP08" ,
                "ERPEP28_EP8_02" ,
                "ERPEP98_EP8_02" ,
                "ERPEPA8_EP8_02" ,
                "ERPEP78_EP8_02" ,
                "ERPEP68_EP8_02" ,
                "ERPEP48_EP8_02" ,
                "ERPEP38_EP8_02" ,
                "ERPEP58_EP8_02", 
                "EQ8",
                };
            string[] names = new string[] { 
                "ERPEP08" ,
                "ERPEP28_EP8_02" ,
                "ERPEP98_EP8_02" ,
                "ERPEPA8_EP8_02" ,
                "ERPEP78_EP8_02" ,
                "ERPEP68_EP8_02" ,
                "ERPEP48_EP8_02" ,
                "ERPEP38_EP8_02" ,
                "ERPEP58_EP8_02", 
                "EQ8",};

            for (int index = 0; index < ids.Length; index++)
            {
                Data.DataItem item = new Data.DataItem();
                item.Id = ids[index];
                item.Name = names[index];
                item.Value = new Random().Next(10, 200).ToString();
                series.DataItems.Add(item);
                System.Threading.Thread.Sleep(20);
            }

            return result;
        }

        /// <summary>
        /// 严重警告top10
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_BADTOP10()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_BADTOP10";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "BADTOP10";
            series.Name = "严重警告top10";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            string[] ids = new string[] { 
                "ERPEP08" ,
                "ERPEP28",
                "ERPEP98",
                "ERPEPA8",
                "ERPEP78",
                "ERPEP68",
                "ERPEP48",
                "ERPEP38",
                "ERPEP58",
                "EQ8",};
            string[] names = new string[] { 
                "ERPEP08" ,
                "ERPEP28",
                "ERPEP98",
                "ERPEPA8",
                "ERPEP78",
                "ERPEP68",
                "ERPEP48",
                "ERPEP38",
                "ERPEP58",
                "EQ8",};

            for (int index = 0; index < ids.Length; index++)
            {
                Data.DataItem item = new Data.DataItem();
                item.Id = ids[index];
                item.Name = names[index];
                item.Value = new Random().Next(1, 15).ToString();
                series.DataItems.Add(item);

                System.Threading.Thread.Sleep(5);
            }

            return result;
        }

        /// <summary>
        /// 告警统计 模拟数据
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_GJTJ()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_GJTJ";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "GJTJ";
            series.Name = "告警统计";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            int value = 100;
            for (int index = 0; index < 15; index++)
            {
                //for (int indexHour = 0; indexHour < 24; indexHour++)
                //{
                    int day =DateTime.Now.AddDays(-1 * index).Date.Day;
                    int month = DateTime.Now.AddDays(-1 * index).Date.Month;
                    int year = DateTime.Now.AddDays(-1 * index).Date.Year;
                    DateTime date = new DateTime(year, month, day);
                    //date = date.AddHours(indexHour);


                    Data.DataItem item = new Data.DataItem();
                    item.Id = date.ToString("yyyy-MM-dd HH:mm:ss");
                    item.Name = date.ToString("yyyy-MM-dd HH:mm:ss");

                    if (index % 2 == 0)
                    {
                        value -= new Random().Next(1, 20);
                    }
                    else
                    {
                        value += new Random().Next(1, 20);
                    }

                    item.Value = value.ToString();
                    series.DataItems.Add(item);
                    System.Threading.Thread.Sleep(5);
                //}
            }

            return result;
        }

        /// <summary>
        /// random flag
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_RF()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_RF";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "RF";
            series.Name = "告警统计";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            Data.DataItem item = new Data.DataItem();
            item.Id = "v";
            item.Name = "v";
            item.Value = new Random().Next(0, 3).ToString();
            series.DataItems.Add(item);

            return result;
        }

        /// <summary>
        /// 带宽利用率
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_DKLYL()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_DKLYL";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "DKLYL";
            series.Name = "带宽利用率";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            string[] ids = new string[] { 
                "核心环石油大厦NE40E-A",
                "数据中心勘探院512508B",
                "核心环网勘探院NE40E-B" ,
                "西安区域中心互联网SR8802-SP1" ,
                "核心环石油大厦NE40E-A" ,
                "数据中心勘探院512508B" ,
                "核心环网勘探院NE40E-B" ,
                "核心环石油大厦NE40E-A" ,
                "数据中心勘探院512508B" ,
                "核心环网勘探院NE40E-B" };
            string[] names = new string[] { 
                "核心环石油大厦NE40E-A",
                "数据中心勘探院512508B",
                "核心环网勘探院NE40E-B" ,
                "西安区域中心互联网SR8802-SP1" ,
                "核心环石油大厦NE40E-A" ,
                "数据中心勘探院512508B" ,
                "核心环网勘探院NE40E-B" ,
                "核心环石油大厦NE40E-A" ,
                "数据中心勘探院512508B" ,
                "核心环网勘探院NE40E-B"};

            for (int index = 0; index < ids.Length; index++)
            {
                Data.DataItem item = new Data.DataItem();
                item.Id = ids[index];
                item.Name = names[index];
                item.Value = new Random().NextDouble().ToString("F2");
                series.DataItems.Add(item);
                System.Threading.Thread.Sleep(20);
            }

            return result;
        }

        /// <summary>
        /// 流量
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_LL()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_DKLYL";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "DKLYL";
            series.Name = "带宽利用率";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            string[] ids = new string[] { 
                "核心环石油大厦NE40E-A",
                "数据中心勘探院512508B",
                "核心环网勘探院NE40E-B" ,
                "西安区域中心互联网SR8802-SP1" ,
                "核心环石油大厦NE40E-A" ,
                "数据中心勘探院512508B" ,
                "核心环网勘探院NE40E-B" ,
                "核心环石油大厦NE40E-A" ,
                "数据中心勘探院512508B" ,
                "核心环网勘探院NE40E-B" };
            string[] names = new string[] { 
                "核心环石油大厦NE40E-A",
                "数据中心勘探院512508B",
                "核心环网勘探院NE40E-B" ,
                "西安区域中心互联网SR8802-SP1" ,
                "核心环石油大厦NE40E-A" ,
                "数据中心勘探院512508B" ,
                "核心环网勘探院NE40E-B" ,
                "核心环石油大厦NE40E-A" ,
                "数据中心勘探院512508B" ,
                "核心环网勘探院NE40E-B"};

            for (int index = 0; index < ids.Length; index++)
            {
                Data.DataItem item = new Data.DataItem();
                item.Id = ids[index];
                item.Name = names[index];
                item.Value = (new Random().NextDouble() * 50).ToString("F2");
                series.DataItems.Add(item);
                System.Threading.Thread.Sleep(20);
            }

            return result;
        }

        /// <summary>
        /// 带宽利用率-表格
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_DKLYL_BG()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_DKLYL_BG";
            result.DataSeries = new List<Data.DataSeries>();

            for (int index = 0; index < 10; index++)
            {
                Data.DataSeries series = new Data.DataSeries();
                series.Id = "DKLYL_BG" + index;
                series.Name = "带宽利用率_表格" + index;
                series.DataItems = new List<Data.DataItem>();
                for (int j = 0; j < 6; j++)
                {
                    Data.DataItem item = new Data.DataItem();
                    item.Id = j.ToString();
                    item.Name = j.ToString();
                    if (j == 0)
                    {
                        item.Value = "核心环网";
                    }
                    else if (j == 1)
                    {
                        item.Value = "核心环网勘探院NE40E-B";
                    }
                    else if (j == 2)
                    {
                        int v = new Random().Next(0, 100);
                        item.Value = (v >= 50) ? "直联" : "电信";
                    }
                    else if (j == 3)
                    {
                        item.Value = "2.000M";
                    }
                    else if (j == 4)
                    {
                        item.Value = new Random().Next(0, 100).ToString() + "%";
                    }
                    else if (j == 5)
                    {
                        item.Value = new Random().Next(0, 255).ToString() + "." + new Random().Next(0, 255).ToString() + "." + new Random().Next(0, 255).ToString() + "." + new Random().Next(0, 255).ToString();
                    }
                    series.DataItems.Add(item);
                    System.Threading.Thread.Sleep(20);
                }


                result.DataSeries.Add(series);
            }

            return result;
        }

        /// <summary>
        /// 网络设备性能Top10
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_WLSBXN()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_WLSBXN";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "WLSBXN";
            series.Name = "网络设备性能";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            string[] ids = new string[] { 
                "华东勘探设计研究院AR46A",
                "华东勘探设计研究院AR46B",
                "中油国际工程有限责任公司-第七建设公司AR46B" ,
                "中油国际工程有限责任公司-第七建设公司AR46A" ,
                "北京区域网络中心SR8808B" ,
                "中油宝世顺MSR30-A" ,
                "宝石电气设备有限公司河北分公司AR2811-A" ,
                "香港秘书局MSR50A" ,
                "中油香港公司",
                "塔西南勘探开发AR46A",
                };
            string[] names = new string[] { 
                "华东勘探设计研究院AR46A",
                "华东勘探设计研究院AR46B",
                "中油国际工程有限责任公司-第七建设公司AR46B" ,
                "中油国际工程有限责任公司-第七建设公司AR46A" ,
                "北京区域网络中心SR8808B" ,
                "中油宝世顺MSR30-A" ,
                "宝石电气设备有限公司河北分公司AR2811-A" ,
                "香港秘书局MSR50A" ,
                "中油香港公司",
                "塔西南勘探开发AR46A",};

            for (int index = 0; index < ids.Length; index++)
            {
                Data.DataItem item = new Data.DataItem();
                item.Id = ids[index];
                item.Name = names[index];
                item.Value = new Random().Next(0, 250).ToString();
                series.DataItems.Add(item);
                System.Threading.Thread.Sleep(20);
            }

            return result;
        }

        /// <summary>
        /// OVISTop10
        /// </summary>
        /// <returns></returns>
        private static Data.DataResult INFODEMO_OVIS()
        {
            Data.DataResult result = new Data.DataResult();
            result.Name = "INFODEMO_OVIS";
            result.DataSeries = new List<Data.DataSeries>();

            Data.DataSeries series = new Data.DataSeries();
            series.Id = "OVIS";
            series.Name = "OVIS";
            series.DataItems = new List<Data.DataItem>();
            result.DataSeries.Add(series);

            string[] ids = new string[] { 
                "销售企业 宁夏",
                "炼化企业 宁夏",
                "销售企业 东北" ,
                "炼化企业 大连" ,
                "油气田企业 吐哈" ,
                "炼化企业 辽河" ,
                "油气田企业 塔里木" ,
                "炼化企业 大庆炼化" ,
                "工程技术服务企业 长城钻探",
                "油气田企业 青海",
                };
            string[] names = new string[] { 
                "销售企业 宁夏",
                "炼化企业 宁夏",
                "销售企业 东北" ,
                "炼化企业 大连" ,
                "油气田企业 吐哈" ,
                "炼化企业 辽河" ,
                "油气田企业 塔里木" ,
                "炼化企业 大庆炼化" ,
                "工程技术服务企业 长城钻探",
                "油气田企业 青海",};

            for (int index = 0; index < ids.Length; index++)
            {
                Data.DataItem item = new Data.DataItem();
                item.Id = ids[index];
                item.Name = names[index];
                item.Value = new Random().NextDouble().ToString("F2");
                series.DataItems.Add(item);
                System.Threading.Thread.Sleep(20);
            }

            return result;
        }
    }
}
